<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>请应⽤ prototype 写⼀个类继承多个类的案例</title>
</head>

<body>
  <script>
    //定义一个Person类
    function Person(name, age) {
      this.name = name;
      this.age = age;
      //定义一个info函数
      this.info = function () {
        document.writeln("年龄" + this.age + "姓名" + this.name);
      }
    }
    //创建Person类的实例对象
    var p1 = new Person('xiaoming', 20);
    //调用p1的info方法
    p1.info();
    var p2 = new Person('wang', 22);
    p2.info();
  </script>
</body>

</html>